Tables (for displaying logs etc)

ImageThe manuals and descriptions for features found on this Message Board.

Forum rules
Image
Post Reply
User avatar
Hans
Scramble Master
Scramble Master
Posts: 4047
Joined: 24 Aug 2002, 11:07
Type of spotter: S5 - Military & Civil
Subscriber Scramble: Yep
Location: The Net
Contact:

Tables (for displaying logs etc)

Post by Hans »

Hi,

With the introduction of phpBB version 3 replaced by the post below.


Regards,

Hans
Last edited by Hans on 16 Aug 2007, 16:04, edited 1 time in total.
User avatar
Hans
Scramble Master
Scramble Master
Posts: 4047
Joined: 24 Aug 2002, 11:07
Type of spotter: S5 - Military & Civil
Subscriber Scramble: Yep
Location: The Net
Contact:

Post by Hans »

Hi,

Sometimes even I learn something very useful :-)
Homer wrote:You can do this very easy - directly from MS Excel with the concatenate function!

Say you have an Excel sheet with 4 columns. Then you put in the fifth column the next statement;

Code: Select all

=CONCATENATE("<tr><td>";A1;"</td><td>";B1;"</td><td>";C1;"</td><td>";D1;"</td></tr>")
You can break this down to;
  • Code: Select all

    =CONCATENATE(
    ==> start of the expression
  • Code: Select all

    ;
    ==> separations of the different items in this statement
  • Code: Select all

    "<tr><td>"
    ==> HTML start of your table row and first table cell. Note the quotes are mandatory!
  • Code: Select all

    "</td><td>"
    ==> HTML colusre of previous cell and opening of next cell. Again the quotes are needed.
  • Code: Select all

    "</td></tr>"
    ==> HTML closure of the last data cell and of the table row
  • Code: Select all

    A1
    ==> contents of Excel cell A1
  • Code: Select all

    B1
    ==> contents of Excel cell B1 (etc)
  • Code: Select all

    )
    ==> end of the expression
For example, rows 16 to 18 of the sheet in which I have the CTSW production list, in cells E16, E17 and E18 I used:

Code: Select all

=CONCATENATE("<tr><td>";A16;"</td><td>";B16;"</td><td>";C16;"</td><td>";D16;"</td></tr>")
=CONCATENATE("<tr><td>";A17;"</td><td>";B17;"</td><td>";C17;"</td><td>";D17;"</td></tr>")
=CONCATENATE("<tr><td>";A18;"</td><td>";B18;"</td><td>";C18;"</td><td>";D18;"</td></tr>")
This had the next 'output';

Code: Select all

<tr><td>OE-7117</td><td>97-10-02-011</td><td>CT</td><td>ex D-MYYZ</td></tr>
<tr><td>D-MZES</td><td>97-10-03-12</td><td>CT</td><td></td></tr>
<tr><td>D-MWMA</td><td>97-11-01-13 ?</td><td>CT</td><td>c/n quoted as 97-11-03-13</td></tr>
only thing you have to do then is copy the complete column to an "ASCII editor with some extras" - like Notepad++ (FREE!), UltraEdit32 or Notetab (Freeware version available) - which has the ability to 'join lines'.

First you insert an

Code: Select all

<table class="genmed" width="800" valign="top">
on the first line - note I also used the 'valign="top"' statement is I personally find the output much prettier when data is split over multiple lines :-)

At the end of the list you put the table closure tag;

Code: Select all

</table>
So now you have something like the following in your editor;

Code: Select all

<table class="genmed" width="800" valign="top">
<tr><td>OE-7117</td><td>97-10-02-011</td><td>CT</td><td>ex D-MYYZ</td></tr>
<tr><td>D-MZES</td><td>97-10-03-12</td><td>CT</td><td></td></tr>
<tr><td>D-MWMA</td><td>97-11-01-13 ?</td><td>CT</td><td>c/n quoted as 97-11-03-13</td></tr>
</table>
In your editor (the ordinary Notepad does not have this ability!) now join all these line to one single line, and copy paste it to your MB posting, and this gives the next output;

<table class="genmed" width="800" valign="top"><tr><td>OE-7117</td><td>97-10-02-011</td><td>CT</td><td>ex D-MYYZ</td></tr><tr><td>D-MZES</td><td>97-10-03-12</td><td>CT</td><td></td></tr><tr><td>D-MWMA</td><td>97-11-01-13 ?</td><td>CT</td><td>c/n quoted as 97-11-03-13</td></tr></table>

Hope this helps!
This helps absolutely ! Thanks a lot!!
User avatar
Key
Site Admin
Site Admin
Posts: 11258
Joined: 06 Dec 2002, 09:21
Type of spotter: F2
Subscriber Scramble: U bet
Location: ex EHAM

Post by Key »

Here's another, very easy method: the use of tags for 'preformatted text':

Code: Select all

[pre] ... [/pre]
(Note that the message composer now even has these tags as buttons to use when posting.)

In between these, tabs in the text will be displayed as such and a fixed font width is being used, giving lists a distinguished look.
The use is very simple, and since a software update here the 'break' <br> does not even apply anymore: just use normal 'returns' for line feeds.

Some extra tabs will often be needed to line up the list. Not very systematic, but simple and effective. ;)
Do notice that you have to format the text (especially adding the tabs) outside the forum interface, as this will jump to the next field on the page when you hit 'Tab' in stead of adding a tab to the text!

To get this...
338/4-CG	Mirage 2000N	EC03.004
38+10		F-4F		JG74
MM7173/51-21	AMX		51St/132 Gr
...put in this

Code: Select all

[pre]338/4-CG	Mirage 2000N	EC03.004
38+10		F-4F		JG74
MM7173/51-21	AMX		51St/132 Gr[/pre]
where there are extra tabs before and after F-4F and after AMX, to line up the columns of varying width.

So, to use this
1. Put a tab-formatted list in a text editor
2. Add the 'pre'-tags around it *
3. Copy and paste the whole text in the message window here *
4. Preview, and put in extra tabs in your text editor as required
5. Repeat steps 3 & 4 as necessary.
6. Post the message!

* Alternatively, leave out the 'pre'-tags in your text editor but add them with the message editor buttons of this forum, after pasting your text in the edit window.

Although this even works in text editors that convert tabs to spaces (because of the fixed font width), I think most will find it easier to use an editor that leaves tabs as they are. But don't worry, even Notepad does this.

Hope this is of use,

Erik

-- Updated jan09 --
Climb to 20ft, we're leaving a dust trail
User avatar
Hans
Scramble Master
Scramble Master
Posts: 4047
Joined: 24 Aug 2002, 11:07
Type of spotter: S5 - Military & Civil
Subscriber Scramble: Yep
Location: The Net
Contact:

Re: Tables (for displaying logs etc)

Post by Hans »

quick and dirty adjustment of the original topic;
==========================================

Hi,

One of the downsides of this message board (in my opinion) was the way logs were displayed.

The main 'problem' is that HTML is unfamiliar with tabs and standard ignores multiple spaces (displaying them as a single space).

So, for instance, this doesn't look very nice, does it?;
338/4-CG Mirage 2000N EC03.004
362/4-CU Mirage 2000N EC03.004
38+10 F-4F JG74
38+29 F-4F JG74
MM7186/51-05 AMX 51St/103 Gr
MM7173/51-21 AMX 51St/132 Gr


With some cheating -eg putting dots between- you at least can allign all columns a bit;
338/4-CG...........Mirage 2000N...EC03.004
362/4-CU...........Mirage 2000N...EC03.004
38+10................F-4F..................JG74
38+29................F-4F..................JG74
MM7186/51-05..AMX.................51St/103 Gr
MM7173/51-21..AMX.................51St/132 Gr


Standard phpBB (the software for this message board) ignores any other HTML code you might want to include in your posts

Therefore we introduced a (limited) set of BBCode instructions, which allows the above log to look like;

[table 300][tr][td]338/4-CG[/td][td]Mirage 2000N[/td][td]EC03.004[/td][/tr][tr][td]362/4-CU[/td][td]Mirage 2000N[/td][td]EC03.004[/td][/tr][tr][td]38+10[/td][td]F-4F[/td][td]JG74[/td][/tr][tr][td]38+29[/td][td]F-4F[/td][td]JG74[/td][/tr][tr][td]MM7186/51-05[/td][td]AMX[/td][td]51St/103 Gr[/td][/tr][tr][td]MM7173/51-21[/td][td]AMX[/td][td]51St/132 Gr[/td][/tr][/table]
One warning though, its quite labor-intensive....

So for those with a basic understanding of BBCode and enough time on their hands here a small 'how-to';
(but please keep in mind that apart from this tutorial we do not support this feature, so when you have any questions, please do not ask us 8-) )

As already stated, only a limited set of BBCode tags are introduced, aimed specifically at displaying those logs in the form of a table.
Those tags are; TABLE, TR and TD

Each table must start with the following line;

Code: Select all

[TABLE 300]
300 is the width of the table: You can vary with it if necessary, although I would recommend not to take any value higher then 700.

For each line in your log, you start with the table-row tag TR.
This is followed by the table-data tags (TD), your data, the TD-closing tag, for each 'part' of your log (eg. registration, type, operator etc).
Each line is then closed by the TR-closing tag.

So for instance the first line in the above log looks like this, though for clarification here each part has been put on a separate line;

Code: Select all

[TR]
 [TD]338/4-CG[/TD]
 [TD]Mirage 2000N[/TD]
 [TD]EC03.004[/TD]
[/TR]
You repeat this for every line in your log.
When you're finished, you only need to close the table again with the table closing tag.

So above log would look like;

Code: Select all

[TABLE 300]
[TR][TD]338/4-CG[/TD][TD]Mirage 2000N[/TD][TD]EC03.004[/TD][/TR]
[TR][TD]362/4-CU[/TD][TD]Mirage 2000N[/TD][TD]EC03.004[/TD][/TR]
[TR][TD]38+10[/TD][TD]F-4F[/TD][TD]JG74[/TD][/TR]
[TR][TD]38+29[/TD][TD]F-4F[/TD][TD]JG74[/TD][/TR]
[TR][TD]MM7186/51-05[/TD][TD]AMX[/TD][TD]51St/103 Gr[/TD][/TR]
[TR][TD]MM7173/51-21[/TD][TD]AMX[/TD][TD]51St/132 Gr[/TD][/TR]
[/TABLE]
There is only one down side to this; because of the way phpBB handles each carriage return, those are put above the actual table - which I will show in a seperate post. So you have to remove all returns from your log (or don't put them in to start with).

The final version of this log look then looks like this;

Code: Select all

[TABLE 300][TR][TD]338/4-CG[/TD][TD]Mirage 2000N[/TD][TD]EC03.004[/TD][/TR][TR][TD]362/4-CU[/TD][TD]Mirage 2000N[/TD][TD]EC03.004[/TD][/TR][TR][TD]38+10[/TD][TD]F-4F[/TD][TD]JG74[/TD][/TR][TR][TD]38+29[/TD][TD]F-4F[/TD][TD]JG74[/TD][/TR][TR][TD]MM7186/51-05[/TD][TD]AMX[/TD][TD]51St/103 Gr[/TD][/TR][TR][TD]MM7173/51-21[/TD][TD]AMX[/TD][TD]51St/132 Gr[/TD][/TR][/TABLE]
For some basic lay out issues you can use the underline, italic and bold tags, like this (remember that each tag has to be closed!);

Code: Select all

[TABLE 500]
[TR]
[TD]Normal text[/TD]
[TD][B]Bold text[/B][/TD]
[TD][U]Underlined text[/U][/TD]
[TD][I]Italic text[/I][/TD]
[/TR]
[/TABLE]
After removing the carriage returns, this looks like;

[table 500][tr][td]Normal text[/td][td]Bold text[/td][td]Underlined text[/td][td]Italic text[/td][/tr][/table]

You can still use the CONCATENATE function of Excel for this as described above, but you need to use the new BBCode-tags instead of the HTML-tags as was the case with the previous version of this Message Board.

One final note; when using this table option I recommend using the Preview option -on the bottom of the page when you are typing your message- extensively!!

Hope this helps!

Regards,

Hans
Last edited by Hans on 31 Dec 2008, 12:02, edited 1 time in total.
Reason: Added the carriage return thing
User avatar
Hans
Scramble Master
Scramble Master
Posts: 4047
Joined: 24 Aug 2002, 11:07
Type of spotter: S5 - Military & Civil
Subscriber Scramble: Yep
Location: The Net
Contact:

Re: Tables (for displaying logs etc)

Post by Hans »

An example of not removing the carriage returns between all lines; as you can see there are now a lot of empty lines between this text and the actual table below, which was not there in the entry/edit screen;

[table 300][tr][td]338/4-CG[/td][td]Mirage 2000N[/td][td]EC03.004[/td][/tr]
[tr][td]362/4-CU[/td][td]Mirage 2000N[/td][td]EC03.004[/td][/tr]
[tr][td]38+10[/td][td]F-4F[/td][td]JG74[/td][/tr]
[tr][td]38+29[/td][td]F-4F[/td][td]JG74[/td][/tr]
[tr][td]MM7186/51-05[/td][td]AMX[/td][td]51St/103 Gr[/td][/tr]
[tr][td]MM7173/51-21[/td][td]AMX[/td][td]51St/132 Gr[/td][/tr][tr][td]338/4-CG[/td][td]Mirage 2000N[/td][td]EC03.004[/td][/tr]
[tr][td]362/4-CU[/td][td]Mirage 2000N[/td][td]EC03.004[/td][/tr]
[tr][td]38+10[/td][td]F-4F[/td][td]JG74[/td][/tr]
[tr][td]38+29[/td][td]F-4F[/td][td]JG74[/td][/tr]
[tr][td]MM7186/51-05[/td][td]AMX[/td][td]51St/103 Gr[/td][/tr]
[tr][td]MM7173/51-21[/td][td]AMX[/td][td]51St/132 Gr[/td][/tr][tr][td]338/4-CG[/td][td]Mirage 2000N[/td][td]EC03.004[/td][/tr]
[tr][td]362/4-CU[/td][td]Mirage 2000N[/td][td]EC03.004[/td][/tr]
[tr][td]38+10[/td][td]F-4F[/td][td]JG74[/td][/tr]
[tr][td]38+29[/td][td]F-4F[/td][td]JG74[/td][/tr]
[tr][td]MM7186/51-05[/td][td]AMX[/td][td]51St/103 Gr[/td][/tr]
[tr][td]MM7173/51-21[/td][td]AMX[/td][td]51St/132 Gr[/td][/tr][tr][td]338/4-CG[/td][td]Mirage 2000N[/td][td]EC03.004[/td][/tr]
[tr][td]362/4-CU[/td][td]Mirage 2000N[/td][td]EC03.004[/td][/tr]
[tr][td]38+10[/td][td]F-4F[/td][td]JG74[/td][/tr]
[tr][td]38+29[/td][td]F-4F[/td][td]JG74[/td][/tr]
[tr][td]MM7186/51-05[/td][td]AMX[/td][td]51St/103 Gr[/td][/tr]
[tr][td]MM7173/51-21[/td][td]AMX[/td][td]51St/132 Gr[/td][/tr][/table]
Post Reply

Return to “Explanations”