tom_hampton
Grandmaster Brewer
- Joined
- Oct 8, 2011
- Messages
- 929
- Reaction score
- 0
Typical tabular results like: $BOIL_INGREDIENTS, and all the other "ingredients" lists don't provide any way to reformat the HTML. The result is always in the form:
Basically, this results in a centered, underlined, and bold Title, followed by a 100% width table with no gridlines. The header row of the table is bolded, and the data rows are plain text.
I'd like to be able to control some/all aspects of these tables (fonts, spacing, grid lines, etc). This could be accomplished with some simple changes to the generated HTML:
<table class="ingredients boil_ingredients" id="boil_ingredients_1">
<caption>Boil Ingredients</caption>
<tr>
<th></th>
...
<th></th>
</tr>
<tr>
<td></td>
...
<td></td>
</tr>
...
</table>
There are a few of changes above:
1. Use of the <caption> tag for the table "title", instead of having the title outside of the table.
2. Use of the <th> tag for the header titles.
3. Addition of the "class" and "id" attributes to each tag, allowing each tag to be styled separately to any desired level of detail.
From the above I can style all ingredients lists (.ingredients selector) the same way, or I can style all boil ingredients (.boil_ingredients selector) lists the same way, or I can style a specific copy of the boil ingredients (#boil_ingredients_1 selector) a certain way.
In addition, I can style each tag within the above:
.ingredients caption { style choices; } // all captions for ingredients lists
.boil_ingredients th { style choices; } // all headers for .boil_ingredients lists specifically
#boil_ingredients_1 td { style choices; } //all table data for the boil_ingredients_1 lists only
Looking through the list of tags that generate tables:
All of the above could be simply "hard coded" in the existing HTML snippets within BeerSmith with the exception of the "ID" attribute because that would be a unique incrementing counter for each usage of the element (still not exactly rocket science). Even without the "ID" attribute, it would give us a great deal of control over the look of these tables with very minor modifications to the BeerSmith source.
My ultimate wishlist for BeerSmith would be to allow the report writer to select the data elements to include in the tablular output (maybe I just want the "amount" and the "description"), and perhaps even include my own custom column(s).
Code:
<center><u><b>Ingredients</b></u></center>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="22%" align="left"><b>
Amt</b></td>
<td width="50%" align="left"><b>
Name</b></td>
<td width="11%" align="left"><b>
Type</b></td>
<td width="4%" align="left"><b>
#</b></td>
<td width="11%" align="left"><b>
%/IBU</b></td>
</tr>
<tr>
<td align="left">
10 lbs 6.0 oz</td>
<td align="left">
Pale Malt, Ale (Barrett Burston) (2.0 SRM)</td>
<td align="left">
Grain</td>
<td align="left">
1</td>
<td align="left">
89.0 %</td>
</tr>
</table>
Basically, this results in a centered, underlined, and bold Title, followed by a 100% width table with no gridlines. The header row of the table is bolded, and the data rows are plain text.
I'd like to be able to control some/all aspects of these tables (fonts, spacing, grid lines, etc). This could be accomplished with some simple changes to the generated HTML:
<table class="ingredients boil_ingredients" id="boil_ingredients_1">
<caption>Boil Ingredients</caption>
<tr>
<th></th>
...
<th></th>
</tr>
<tr>
<td></td>
...
<td></td>
</tr>
...
</table>
There are a few of changes above:
1. Use of the <caption> tag for the table "title", instead of having the title outside of the table.
2. Use of the <th> tag for the header titles.
3. Addition of the "class" and "id" attributes to each tag, allowing each tag to be styled separately to any desired level of detail.
From the above I can style all ingredients lists (.ingredients selector) the same way, or I can style all boil ingredients (.boil_ingredients selector) lists the same way, or I can style a specific copy of the boil ingredients (#boil_ingredients_1 selector) a certain way.
In addition, I can style each tag within the above:
.ingredients caption { style choices; } // all captions for ingredients lists
.boil_ingredients th { style choices; } // all headers for .boil_ingredients lists specifically
#boil_ingredients_1 td { style choices; } //all table data for the boil_ingredients_1 lists only
Looking through the list of tags that generate tables:
TAG | Classes | ID |
$MASH_INGREDIENTS | ingredients, grains, mash_ingredients_table | mash_ingredients_n |
$FERMENTABLES | ingredients, grains, fementables_table | fermentables_n |
$STEEP_INGREDIENTS | ingredients, grains, steep_ingredients | steep_ingredients_n |
$FERMENT_INGREDIENTS | ingredients, misc, ferment_ingredients_table | ferment_ingredients_n |
$BOTTLING_INGREDIENTS | ingredients, misc, bottling_ingredients_table | bottling_ingredients_n |
$PRIMARY_INGREDIENTS | ingredients, misc, primary_ingredients_table | primary_ingredients_n |
$SECONDARY_INGREDIENTS | ingredients, misc, secondary_ingredients_table | secondary_ingredients_n |
$INGREDIENTS | ingredients, misc, ingredients_table | ingredients_n |
$MISCS | ingredients, misc, miscs_table | miscs_n |
$FIRST_WORT_HOPS | ingredients, hops, first_wort_hops_table | first_wort_hops_n |
$HOPS | ingredients, hops, hops_table | hops_n |
$STEEP_HOPS | ingredients, hops, steep_hops_table | steep_hops_n |
$YEASTS | ingredients, yeasts_table | yeasts_n |
$MASH_STEPS | steps, mash_steps_table | mash_steps_n |
$SPARGE_STEPS | steps, sparge_steps_table | sparge_steps_n |
$WATER_PREP | water, water_prep | water_prep_n |
All of the above could be simply "hard coded" in the existing HTML snippets within BeerSmith with the exception of the "ID" attribute because that would be a unique incrementing counter for each usage of the element (still not exactly rocket science). Even without the "ID" attribute, it would give us a great deal of control over the look of these tables with very minor modifications to the BeerSmith source.
My ultimate wishlist for BeerSmith would be to allow the report writer to select the data elements to include in the tablular output (maybe I just want the "amount" and the "description"), and perhaps even include my own custom column(s).