0
$\begingroup$

I want to have field hints in a 3 x 2 grid input fields, such that there is one hint specific to the input fields in the 1st column and another one for the 2nd column.

I also want to adjust the field size of the two columns.

Doubts:

1.Should the value of InputField be a string if FieldHint is used. (As shown in Figure 1)

InputField["", String, FieldHint -> "Enter Text here"]
InputField["", Number, FieldHint -> "Enter Number here"]

2.Is this a better way to manage a grid properties (As shown in figure 2)

Grid[Table[
InputField["", String, FieldHint -> "Enter Force", 
FieldSize -> {w, h}], {h, {1, 1, 1, 1}}, {w, {5, 3}}]] 

3.Does assigning a grid to a variable and manipulating the variable make sense. If not what are the other ways to implement this logic.(As shown in figure 3)

enter image description here

$\endgroup$
  • $\begingroup$ Hi, welcome to Mathematica.SE, please take the tour. Here its considered helpful and polite show you own efforts and share your data and code attempts in a well formatted form, so we can quickly see the problem you are facing. Please help us to help you abd edit your question accordingly. Only good questions inspire great answers. $\endgroup$ – rhermans Sep 11 '15 at 13:02
  • 3
    $\begingroup$ Sai, can you show us what code you have produced so far, so that we can understand your goal better, and modify your existing code to suit your purposes? $\endgroup$ – MarcoB Sep 11 '15 at 13:14
3
$\begingroup$
dims = {3, 2};
a = ConstantArray[Null, dims];
fieldH = Array ["Hint " <> ToString@# &, dims[[2]]];
fieldS = Array [ 10 # &, dims[[2]]];
Framed@Grid@
  Array[InputField[Dynamic[a[[##]]], 
                   FieldSize -> fieldS[[#2]],  
                   FieldHint -> fieldH[[#2]]] &, 
        dims]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.