0 votes
by (140 points)
Hi I am new to twine and everything but i can't figure out how to make a border table in sugarcube

1 Answer

0 votes
by (23.6k points)

You make tables using normal html:

 <table style="width:100%">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Jill</td>
    <td>Smith</td>
    <td>50</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td>
    <td>94</td>
  </tr>
</table> 

To give it a border you can use your CSS stylesheet:

table, th, td {
  border: 1px solid white;
}

For more information on how you can style your table look over here.

by (68.6k points)

SugarCube's UI uses tables in various places and completely general rules will also affect them, possibly in detrimental ways.  This is true for most HTML elements, so be you should be specific when possible.

In this case, I'd definitely suggest using either an ID or class to make those style rules specific to the table(s) in question.  For example, an HTML table with a class:

<table class="border-table">
	<!-- rest of table tags here -->
</table>

And some example CSS rules that only target tables including that specific class:

.border-table {
	width: 100%;
}
.border-table,
.border-table th,
.border-table td {
	border: 1px solid #fff;
}

 

...