|
|
#1 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
horizontally center table in mobi7?
I'm using the following css which works for epub but when I look at the dual mobi (converted with kindlegen) in the Mobipocket Reader the tables are at the left.
PHP Code:
|
|
|
|
|
|
#2 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,876
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
table.YourTable {
margin-top: 1em;
border-collapse: collapse;
}
blockquote.MyTable {
text-align: center;
}
Code:
<blockquote class="MyTable">
<table class="YourTable" border="1">
<thead>
<tr>
<th>First column</th>
<th>Second Column</th>
</tr>
</thead>
<tbody>
<tr>
<td>Some text here</td>
<td>And more text here too</td>
</tr>
<tr>
<td>This for ending</td>
<td>And this too</td>
</tr>
</tbody>
</table>
</blockquote>
EDIT: Also you could try to enclose the table inside a <div> block. For example: Code:
<div class="MyTable>
<table>
...
...
</table>
</div>
Code:
div.MyTable {
text-align: center;
}
Last edited by RbnJrg; 08-22-2019 at 08:55 AM. |
|
|
|
|
| Advert | |
|
|
|
|
#3 | |
|
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
If memory serves, using embedded blockquotes or even a single blockquote will indent it, but not center it. You can't put a table inside a paragraph, so...try centering a div and putting the table inside that. Yes, never mind, I see that Ruben already suggested that. Hitch |
|
|
|
|
|
|
#4 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Ah, ok; thanks guys. I'll have to think about how ugly I want to make my html in order to make the mobi output nice.
Is there a way to have conditional html? For example, in my css I have the following; is there anything equivalent for html? PHP Code:
|
|
|
|
|
|
#5 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Unless kindlegen has something I guess there isn't any conditional HTML, although I did forget about the stuff that IE used.
PHP Code:
|
|
|
|
| Advert | |
|
|
|
|
#6 | |
|
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
|
|
|
|
|
#7 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,876
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
You can employ something like:Code:
@media amzn-mobi {
.kf7 {
display: normal;
}
.kf8 {
display: none;
}
}
@media not amzn-mobi {
.kf7 {
display: none;
}
.kf8 {
display: normal;
}
}
Code:
<div class="kf7">
<blockquote class="MyTable">
<table class="YourTable" border="1">
<thead>
<tr>
<th>First column</th>
<th>Second Column</th>
</tr>
</thead>
<tbody>
<tr>
<td>Some text here</td>
<td>And more text here too</td>
</tr>
<tr>
<td>This for ending</td>
<td>And this too</td>
</tr>
</tbody>
</table>
</blockquote>
</div>
<div class="kf8">
<table>
<thead>
<tr>
<th>First column</th>
<th>Second Column</th>
</tr>
</thead>
<tbody>
<tr>
<td>Some text here</td>
<td>And more text here too</td>
</tr>
<tr>
<td>This for ending</td>
<td>And this too</td>
</tr>
</tbody>
</table>
</div>
|
|
|
|
|
|
|
#8 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Quote:
Although I could use that to put a big warning at the top of each chapter saying something like "Upgrade your derned Kindle already!"
|
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| epub to mobi7, all text is italics | lumpynose | Kindle Formats | 1 | 08-16-2019 06:11 PM |
| How to center images in OLD mobi7 for Voyage | GrannyGrump | Kindle Formats | 16 | 07-13-2016 11:44 PM |
| merge MOBI7 and AZW3 | gregorio | Kindle Formats | 1 | 10-29-2012 09:02 AM |
| eBooks of chess problems. Center table bug? | Tibor | ePub | 6 | 03-05-2009 09:20 AM |
| Read books horizontally | mapletony | Sony Reader | 10 | 01-25-2008 04:36 PM |