Skip to content

Can this make a cell span columns or rows? #14

Open
ZaLiTHkA opened this issue Feb 14, 2020 · 3 comments
Open

Can this make a cell span columns or rows? #14

ZaLiTHkA opened this issue Feb 14, 2020 · 3 comments

Comments

@ZaLiTHkA
Copy link

I'm working through a number of different Angular "table builder" modules at the moment, found this one just now and it was by far the easiest to get going with straight-out-the-box. The others that I've looked at so far have simply been way too "over the top" with functionality that my current project will literally never use... However, there are a few small things I'm battling to work out here.

Not sure if I'm just missing something from the examples on the linked stackblitz.io page, but perhaps someone could tell me if ng-table-builder can generate tables with the following example layout:

Table Title
Label: Value Label: Value
Label: Value Label: Value

This involves two things that I haven't managed to work out so far:

  1. Using the colspan attribute to make one header cover all columns (I would also like to use rowspan, but that's not required)
  2. Showing multiple entries per row, so where my source data is an array of 4 entries, and I have 2 on each table row.

Regarding point 2, if this module has no way to cater for this specifically, I can quite easily restructure my source data on the fly to have 2 entries, joining them in code before pushing them to the table... So that's no big issue, but the column (and hopefully row) spanning is a necessity for me.

Any ideas?

@ZaLiTHkA
Copy link
Author

Ok, hang on.. I just noticed the ngx-header and ngx-footer, which almost works for the example in my previous post. However I can't seem to get rid of the column header row, it's either an empty cell, a custom string, or extrapolated from the column source.

In order words, the closest I can get using ngx-header is effectively (with different markup, obviously):

Table Title
       
Label: Value Label: Value
Label: Value Label: Value

@splincode
Copy link
Member

currently the column names cannot be disabled, if this is a bug, I can start this issue

@ZaLiTHkA
Copy link
Author

ZaLiTHkA commented Feb 14, 2020

I wouldn't call that a bug, no.. But looking through the options presented by WebStorm's intellisense on the ngx-column markup element, it seems there are currently no options to "hide" or "disable" the header, so that would just be a nice feature to have. :)

Unfortunately though, having the ability to configure column and/or row spanning is a necessity for my current project, so that is still the most important part of my query here.


Here's a table example that can't be built without the use of colspan on certain cells:

Device A Device B
Section Title
Category: value 1 value 2
Category: value 1 value 2
Section Title
Category: value 1 value 2
Category: value 1 value 2

FWIW: the reason I'm looking to use a table "builder" system of sorts (as opposed to simply using static markup) is because the app in which this is used needs to cater for a variable number of "devices" in the above example... So as more of them are included in the source data, the table will grow horizontally with an additional column for each one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants