Browse Source

表格单元格未设置列宽时等分

natasha 1 day ago
parent
commit
0509e4fba3

+ 2 - 10
src/views/book/courseware/preview/components/table/TablePreview.vue

@@ -10,11 +10,7 @@
           width: isMobile ? '100%' : data.property.width + 'px',
           width: isMobile ? '100%' : data.property.width + 'px',
         }"
         }"
       >
       >
-        <table
-          :style="{
-            width: '100%',
-          }"
-        >
+        <table style="width: 100%; table-layout: fixed">
           <colgroup>
           <colgroup>
             <col v-for="(item, i) in data.col_width" :key="`col-${i}`" :style="{ width: `${item.value}%` }" />
             <col v-for="(item, i) in data.col_width" :key="`col-${i}`" :style="{ width: `${item.value}%` }" />
           </colgroup>
           </colgroup>
@@ -255,11 +251,7 @@
             height: data.property.height + 'px',
             height: data.property.height + 'px',
           }"
           }"
         >
         >
-          <table
-            :style="{
-              width: '100%',
-            }"
-          >
+          <table style="width: 100%; table-layout: fixed">
             <colgroup>
             <colgroup>
               <col v-for="(item, i) in data.col_width" :key="`col-${i}`" :style="{ width: `${item.value}%` }" />
               <col v-for="(item, i) in data.col_width" :key="`col-${i}`" :style="{ width: `${item.value}%` }" />
             </colgroup>
             </colgroup>