bbcode : How to draw a table - forum

Is there any way to draw a table in a forum which uses bb code if [Table] tab is not supported ?
The tags being allowed in the forum are :
[b], [i], [u]
[color]
[size]
[font]
[highlight]
[left], [right], [center]
[indent]
[email]
[url]
[thread]
[post]
[list]
[img]
[quote]
[noparse]
[attach]

Do not think so.
But, depending on your purpose, it may be sufficient to force a monotype font (e.g. Courier) using the [font] tag, and then simply "draw" your table by hand using ASCII characters. For example:
[font=courier]
-----------------
| Col A | Col B |
-----------------
| 1 | X |
| 2 | Y |
| 3 | Z |
-----------------
[/font]
Certainly, it is troublesome and may be considered dirty, but your set of available tools is pretty limited.

The [code][/code] tag will maintain white spacing. Example at
http://www.bbcode.org/examples/?id=15. I can see that [code] tags may not be allowed in your forum but are they truly disabled? If so, is there any possibility of turning them on?
Alternatively, I would try Wojciech Żółtak's idea to use a monospaced font.
Finally, you could take a screen cap of the table and insert it as an image. Include the table text as part of the image's alt and/or title tag.

Related

Alternate row colour by data in fields in a spreadsheet

Good Afternoon all,
I've had a search but can't find the answer - please direct me if there is one!
I'm looking to make my spreadsheet have better readability to the user. It requires a lot of manual work outside of the sheet, so the less time strain the spreadsheet is, the better.
I know to to use =mod() in Conditional Formatting but this isn't what I'm looking for
I also know about opening the filter drop down, and clicking one cell, pressing down twice and pressing space bar (rinse and repeat) - but I'm not going to do this over 1000 rows...
Is there a way to alternate the colours from a filtered name in excel?
For example:
+---------------+---------------+--------------+
| Site Code | Site Name | Changed Date |
+---------------+---------------+--------------+
| 000020 | Bobs site | 28/11/18 | <-- colour 1
| 000020 | Bobs site | 26/11/18 | <-- colour 1
| 059201 | Julian's | date | <-- colour 2
| 059201 | Julian's | date | <-- colour 2
| 002237 | etc. 1 | date | <-- colour 1
| 523878 | etc. 2 | date | <-- colour 2
| 523878 | etc. 3 | date | <-- colour 2
+---------------+---------------+--------------+
So rather than by line number, it would be by the name "bobs site" would be one colour, the next in the list would be another colour etc
I would love for this to apply to site code and site name, so when filtering by either, the rows are highlighted correctly.
I can't do this in the =mod() kind of way, as some sites have just one entry, most have 2 and a few can have up to 10
EDIT: Proof of the answer working for future references
Doable with a helper column and Conditional Formatting with COUNTIF and MOD.
In the helper column:
=OR(A2<>A1,B2<>B1)
which returns TRUE or FALSE if the site code or site name has changed (or not) compared to the previous row.
Then 2 conditional formatting rules:
=MOD(COUNTIF($D$2:$D2,TRUE),2)=0
=MOD(COUNTIF($D$2:$D2,TRUE),2)=1
The mixed reference ($D$2:$D2) in the COUNTIF will allow for each separate section to be coloured alternately as the instances of TRUE are successively added up.
One solution; get all uniq values in a seperate column, copy column you want to refer to, paste to new column, remove duplicates.
Then select area with data and start refering those values you want to have that color i conditional formatting.
Edit
With more options use "AND" or "OR"

Table Format Report in Acumatica

I want to design a report in table format. I am using Panel and Line Control for now, but it's time consuming to adjust. Is there a better way to do this?
Example:
| column1 | column2 | column3 |
| aaaaa1 | sdf | sdfsdf |
| aaaaa2 | sdf | sdfsdf |
| aaaaa3 | sdf | sdfsdf |
The row background color should be alternating (gray & white).
Your question is a bit ambiguous I am going to assume you mean using the Report designer you would like to generate a report that looks like the image below.
That being said you have two different items you have to accomplish the table layout and the alternating Row color.
For the Table Layout
Unless I am missing something this is the easy part you only need to use the field controls and border settings on the controls to generate the grids. I have added a screen cap of the standard layout for the report above in the designer
For the Alternating Row Color
This is the challenge because without a little but of work it cant be done. What you have to do is using the visible expression create two sets of duplicate controls one placed directly on top of each other. I used the row number to build my expression that looked like
=IIf( $RowNumber % 2 = '0', True, False )
=IIf( $RowNumber % 2 = '0', False, True )
That divides each row number by two and if there is a remainder (Bottom equation) shows it and vise versa for the other set of controls.

Vertical Align in Livecode

I want to vertically align the text of the label in livecode like aligning to top, middle, or bottom.
----------------------------------
| top text |
| |
| |
---------------------------------
---------------------------------
| |
| middle text |
| |
---------------------------------
---------------------------------
| |
| |
| bottom text |
---------------------------------
Is there any way to do that? If no, is there an alternate way to do that?
There is no built-in way to automatically position label text as you describe. However, unless you require the text formatting properties of a field, using a button as a label may better serve your needs because of its default ability to automatically center text vertically.
Something like the following should get you most of the way. You can paste the script in the button directly and dispatch "updateMyTextAlignment <value>" to the button with a value of "top", "middle" or "bottom". But assuming you're going to have multiple custom labels in your stack, a better option would be to apply the following as a behavior to all your label buttons.
command updateMyTextAlignment pValue
put effective textSize of me into TS
put effective textHeight of me into TH
switch pValue
case "top"
set topMargin of me to -(height of me) + TS + TH
break
case "middle"
set topMargin of me to 0 -- may need to adjust this amount
break
case "bottom"
set topMargin of me to height of me - TS - TH
end switch
end updateMyTextAlignment
Unfortunately there is no option in the properties window but you can do this with a simple script like
set the topMargin of field theField to (round(((the height of field theField - the formattedHeight of field theField)/2)) + the topMargin of field theField)
Example for top margin
Update:
Easiest example for top margin:
set the topMargin of field theField to 0
and then adjust 0 to whatever value you want from the top, e.g. your font size or so.
for middle I'd use something like
set the topMargin of field theField to (the height of field theField / 2)
and maybe adjust this by factoring the font size in too.

Summing up a related table's values in PowerPivot/DAX

Say I have two tables. attrsTable:
file | attribute | value
------------------------
A | xdim | 5
A | ydim | 6
B | xdim | 7
B | ydim | 3
B | zdim | 2
C | xdim | 1
C | ydim | 7
sizeTable:
file | size
-----------
A | 17
B | 23
C | 34
I have these tables related via the 'file' field. I want a PowerPivot measure within attrsTable, whose calculation uses size. For example, let's say I want xdim+ydim/size for each of A, B, C. The calculations would be:
A: (5+6)/17
B: (7+3)/23
C: (1+7)/34
I want the measure to be generic enough so I can use slicers later on to slice by file or attribute. How do I accomplish this?
I tried:
dimPerSize := CALCULATE([value]/SUM(sizeTable[size])) # Calculates 0
dimPerSize := CALCULATE([value]/SUM(RELATED(sizeTable[size]))) # Produces an error
Any idea what I'm doing wrong? I'm probably missing some fundamental concepts here of how to use DAX with relationships.
Hi Redstreet,
taking a step back from your solution and the one proposed by Jacob, I think it might be useful to create another table that would aggregate all the calculations (especially given you probably have more than 2 tables with file-specific attributes).
So I have created one more table that contains (only) unique file names, and thus the relationships could be visualized this way:
It's much simpler to add necessary measures (no need for calculated columns). I have actually tested 2 scenarios:
1) create simple SUM measures for both Attribute Value and File Size. Then divide those two measures and job done :-).
2) use SUMX functions to have a bit more universal solution. Then the final formula for DimPerSize calculation could look like this:
=DIVIDE(
SUMX(DISTINCT(fileTable[file]),[Sum of AttrValue]),
SUMX(DISTINCT(fileTable[file]),[Sum of FileSize]),
BLANK()
)
With [Sum of AttrValue] being:
=SUM(attrsTable[value])
And Sum of FileSize being:
=SUM(sizeTable[size])
This worked perfectly fine, even though SUMX in both cases goes over all instances of given file name. So for file B it also calculates with zdim (if there is a need to filter this out, then use simple calculate / filter combination). In case of file size, I am using SUMX as well, even though it's not really needed since the table contains only 1 record for each file name. If there would be 2 instances, then use SUMX or AVERAGEX depending on the desired outcome.
This is the link to my source file in Excel (2010).
Hope this helps.
You look to have the concept of relationships OK but you aren't on the right track in terms of CALCULATE() either in terms of the structure or the fact that you can't simply use 'naked' numerical columns, they need to be packaged in some way.
Your desired approach is correct in that once you get a simple version of the thing running, you will be able to slice and dice it over any of your related dimensions.
Best practice is probably to build this up using several measures:
[xdim] = CALCULATE(SUM('attrstable'[value]), 'attrstable'[attribute] = "xdim")
[ydim] = CALCULATE(SUM('attrstable'[value]), 'attrstable'[attribute] = "ydim")
[dimPerSize] = ([xdim] + [ydim]) / VALUES('sizeTable'[size])
But depending on exactly how your pivot is set up, this is likely to also throw an error because it will try and use the whole 'size' column in your totals. There are two main strategies for dealing with this:
Use an 'iterative' formula such as SUX() or AVERAGEX() to iterate individually over the 'file' field and then adds up or averages for the total e.g.
[ItdimPerSize] = AVERAGEX(VALUES('sizeTable'[file]), [dimPerSize])
Depending on the maths you want to use, you might find that produce a useful average that you need to use SUMX but devide by the number of cases i.e. COUNTROWS('sizeTable'[file]).
You might decide that the totals are irrelevant and simply introduce an error handling element that will make them blank e.g.
[NtdimPerSize] = IF(HASONEVALUE('sizeTable'[file]),[dimPerSize],BLANK())
NB, all of this assumes that when you are creating your pivot that you are 'dragging in' the file field from the 'sizetable'.

Excel if statement with multiple if statements

Help!
I enjoy Excel but I wanted to see if this were an option. I might even consider coding this in a simple javascript or so file.
I am trying to make a code that can be copied and dragged down on each new file that is made from our server.
On the file, there are NPA's and NXX's. If you aren't sure what that is, it is the area code and prefix. Like 555-111-2222. 555 is the NPA and the 111 is the NXX.
Well, I would like to create an IF statement that capture the various NPA and NXXs combinations and what their carrier is for our markets.
For example, 479-203 is Centurylink. However, 479 is in column N and 203 is in column O.
While I can create, if N2 = "479" and O2 = "203", CenturyLink, --- do another if statement.
I was not sure since I have another excel document that does not change with the values present if I could use that to help answer the question.
In columns A and B on another document have the NPA and NXXs. In the same file, column L has the carrier name.
Is there a search capability that I can use for this? If you name the function, I'll look it up too. I'm not picky. :)
Edit:
=IF(OR(N10="479",N10="870"),VLOOKUP(CONCATENATE(N10,"-",O10),[TnList.xls]AR!$A:$D,4,FALSE),VLOOKUP(CONCATENATE(N10,"-",O10),[TnList.xls]KS!$A:$D,4,FALSE))
You will need to add another column to the left of the data in your carrier spreadsheet and fill it with =CONCATENATE(B2,"-",C2) first:
CarrierSpreadsheet.xls:
NPA-NXX | NPA | NXX | Carrier
429-203 | 429 | 203 | CentryLink
123-111 | 123 | 111 | CarrierA
456-222 | 456 | 222 | CarrierB
789-333 | 789 | 333 | CarrierC
Then add 2 columns to your phone number data determine the carrier from your phone number spreadsheet. Column B needs to be filled with =LEFT(C2,7) and column A needs to be filled with =VLOOKUP(B2,[CarrierSpreadsheet.xls]Sheet1!$A:$D,4,FALSE):
PhoneNumbers.xls
Carrier | NPA-NXX | Number
CentryLink | 429-203 | 429-203-9999
CentryLink | 429-203 | 429-203-8888
CarrierB | 456-222 | 456-222-9999
CarrierC | 789-333 | 789-333-9999
Let me know if you have any questions.
PS - If this answer works for you please click the grey checkmark to the upper left corner or my answer.
You can use a LOOKUP formula which avoids adding extra columns, e.g.
=LOOKUP(2,1/(Data!A$2:A$100=N2)/(Data!B$2:B$100=O2),Data!L$2:L$100)
That assumes Data worksheet is your "other file"
You could name the columns; then the formula can simply refer to the names. But you'd have to name the relevant columns in each document; I'm not sure how well that would work for you.

Resources