Quote:
Originally Posted by Artie
Hello, I kindly ask if it is possible to have tables in an ePub file.
|
Yes. See this topic from a few months ago:
"Formatting tables best practices"
Quote:
Originally Posted by Artie
I am only capable to handle the document in Google Drive. It exports .EPUB, but I cannot control the table. Sometimes they act weirdly.
|
What do you mean it "acts weirdly"?
Probably because Google Docs creates absolutely atrocious HTML. But there's no reason you can't open the EPUB up in Sigil (or Calibre's Editor) and clean up the crud.
HTML Tables pretty much just boil down to these simple parts:
- <table>
- <tr>
- Use this for every new row.
- <th>
- <td>
Code:
<table>
<tr>
<th>First</th>
<th>Last</th>
</tr>
<tr>
<td>John</td>
<td>Smith</td>
</tr>
<tr>
<td>Joanne</td>
<td>Laster</td>
</tr>
</table>
Quote:
Originally Posted by Artie
I would like to generate a paper with simple tables, and export to EPUB. No more than four or five columns with numbers, and some merged cells.
|
Merged cells are a little more complicated in HTML, and they get QUITE confusing if trying to code them by hand.
You'd have to use this stuff called:
- rowspan
- How many merged rows the cell is.
- colspan
- How many merged columns the cell is.
Code:
<table>
<tr>
<th colspan="2">FullNames</th>
</tr>
<tr>
<td>John</td>
<td>Smith</td>
</tr>
[...]
</table>
What I do is use an external program (like LibreOffice Calc) to design the complicated table, then export to HTML and do my cleanup elsewhere.
(Google Docs should already be fine for this!)
Side Note: Most tools don't export Accessible HTML though, so you'll have to do manual tweaking anyway.
They do dumb stuff like use "<td> + bold it" for headings... instead of using the actual HTML <th>.
The reason why proper HTML is so important is when devices like Text-to-Speech try to read the table:
- With <th>, they will know WHICH columns are "First Names" + "Last Names".
- With <td> + bold, they will just think "First" and "Last" is just another row of data.