simonstewart/swagger-to-PDF

Too much vertical spacing in the "responses" table

Opened this issue · 1 comments

Too much vertical spacing in the "responses" table

To fix this we need to change the width of the columns in this section: it starts at row 543. I have tried change this lines width responseSchemaHTML += " <td style='width:20%'><b>Schema type</b></td>"; and then we need another class for td-alignment-small bellow that has the same width that we set above. If you play with does value you could find something that looks more like you want it.

                // response schema
                var hasResponseSchema = false;
                var responseSchemaHTML = "";
                responseSchemaHTML += "       <table class='table-margin' style='margin-left:-5px!important'>";                
                if(typeof responseSchema !== "undefined"){
                    if(typeof responseSchema.type !== "undefined"){
                        responseSchemaHTML += "   <tr>";
                        responseSchemaHTML += "       <td style='width:20%'><b>Schema type</b></td>";
                        responseSchemaHTML += "       <td style='width:80%'>" + responseSchema.type  + "</td>";
                        responseSchemaHTML += "   </tr>";
                        hasResponseSchema = true;
                    }

                    // response schema items
                    var responseSchemaItems = responseSchema.items;
                    if(typeof responseSchemaItems !== "undefined") {
                        responseSchemaHTML += "   <tr>";
                        responseSchemaHTML += "       <td class='td-alignment-small'>&nbsp;</td>";
                        responseSchemaHTML += "       <td class='td-alignment-std'>" + renderSchemaItems(responseSchemaItems, swaggerJSON.definitions) + "</td>";
                        responseSchemaHTML += "   </tr>";
                        hasResponseSchema = true;
                    }
                    else{
                        responseSchemaHTML += "   <tr>";
                        responseSchemaHTML += "       <td class='td-alignment-small'>&nbsp;</td>";
                        responseSchemaHTML += "       <td class='td-alignment-std'>" + renderSchemaItems(responseSchema, swaggerJSON.definitions) + "</td>";
                        responseSchemaHTML += "   </tr>";
                        hasResponseSchema = true;
                    }
                }